package sd.qd.xiaoming.coffeedesk.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import sd.qd.xiaoming.coffeedesk.dao.DictionaryDAO;

@Controller
@RequestMapping("/")
public class MainController {
    
    @Resource
    private DictionaryDAO        dao;
    
    @RequestMapping(method = RequestMethod.GET)
    public String toIndex(final Model model) {
        model.addAttribute("app_name", this.dao.getByCode("app_name").getName());
        model.addAttribute("app_author", this.dao.getByCode("app_author")
                .getName());
        return "index";
    }
    
}
